var express = require('express');
var router = express.Router();
const db = require('./db/db');
const { sendData } = require('./common/common');

/* GET home page. */
router.get('/list', function (req, res, next) {
    let {id} = req.query;
    if(id){
    let sql = `select * from join_goods`;
    db.query(sql,(err,data)=>{
        if(data&&data.length){
            sendData(res,0,'请求众筹列表成功',data)
        }else{
            sendData(res,1,'请求众筹列表出错');
        }
    }) 
    }else{
        sendData(res,1,'未传入用户ID');
    }
});




module.exports = router;
